<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    let obj = {
        name: 'zs',
        age: 18,
        sex: '男'
    }

    // 1、完成解构
    // let { name, age, sex } = obj
    // console.log(name, age, sex);
    // 2、不完全解构
    // console.log(obj.age);
    // const { age } = obj
    // console.log(age);
    // 3、赋初值
    var { name, age = 20 } = { name: 'ls' }
    console.log(name, age);
</script>
<script>
    // console.log(window);
</script>
<script>
    $.post('url', function (res) {
        //         {
        //     "msg": "操作成功",
        //     "code": 0,
        //     "data": [
        //         {
        //             "imgUrl": "https://online-course.nos-eastchina1.126.net/vue%E5%85%A8%E5%AE%B6%E6%A1%B6-1256431472215064576.jpg",
        //             "imgUrlPc": "https://online-course.nos-eastchina1.126.net/vue%E5%85%A8%E5%AE%B6%E6%A1%B6-1256431492473552896.jpg",
        //             "orderBy": 201,
        //             "id": 141,
        //             "time": "2020-05-02 11:53:12",
        //             "type": "course"
        //         },
        //         {
        //             "imgUrl": "https://online-course.nos-eastchina1.126.net/%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B8%8E%E7%AE%97%E6%B3%95%20%E5%9F%BA%E7%A1%80%E7%AF%87-1244541018989133824.jpg",
        //             "imgUrlPc": "",
        //             "orderBy": 201,
        //             "id": 133,
        //             "time": "2020-03-30 16:24:45",
        //             "type": "course"
        //         },
        //         {
        //             "imgUrl": "https://online-course.nos-eastchina1.126.net/520-1262567407382167552.png",
        //             "imgUrlPc": "https://online-course.nos-eastchina1.126.net/pc%E8%BD%AE%E6%92%AD_%E6%8B%B7%E8%B4%9D%203-1262567425946157056.png",
        //             "orderBy": 200,
        //             "id": 151,
        //             "time": "2020-05-18 21:34:58",
        //             "type": "course"
        //         },
        //         {
        //             "imgUrl": "https://online-course.nos-eastchina1.126.net/%E5%AD%A6%E9%95%BF%E9%9D%A2%E5%AF%B9%E9%9D%A2-1260854010470989824.png",
        //             "imgUrlPc": "https://online-course.nos-eastchina1.126.net/pc%E8%BD%AE%E6%92%AD-1260854028233867264.png",
        //             "orderBy": 200,
        //             "id": 149,
        //             "time": "2020-05-14 16:46:52",
        //             "type": "course"
        //         },
        //         {
        //             "imgUrl": "https://online-course.nos-eastchina1.126.net/%E5%B9%B8%E8%BF%90%E5%A4%A7%E8%BD%AC%E7%9B%98_%E8%BD%AE%E7%9B%98-1259782012911222784.png",
        //             "imgUrlPc": "https://online-course.nos-eastchina1.126.net/%E5%B9%B8%E8%BF%90%E5%A4%A7%E8%BD%AC%E7%9B%98_%E8%BD%AE%E7%9B%98-1259782060583682048.png",
        //             "orderBy": 200,
        //             "id": 143,
        //             "time": "2020-05-05 23:00:47",
        //             "type": "course"
        //         }
        //     ]
        // }
        console.log(res);
        let { code, data, msg } = res
    })
</script>

</html>